import {
  reqQueryRoleList, //发送请求;
  reqBatchAddRole,
} from '@/views/Custom/SystemSettingsMng/RoleMenuMng/api/RoleMng';
const actions = {
  // 查询全部角色列表
  async getAllRoleList({ commit }) {
    let result = await reqQueryRoleList();
    commit('GETALLROLELIST', result.data.roleList);
  },
  async batchAddRole({ commit }, params) {
    let result = await reqBatchAddRole(params);
    return result;
  },
};
const mutations = {
  GETALLROLELIST(state, result) {
    state.roleList = result;
  },
};
const state = {
  roleList: [],
};
const getters = {
  roleList(state) {
    return state.roleList || [];
  },
};
export default {
  namespaced: true,
  actions,
  mutations,
  state,
  getters,
};
